@extends('admin.app')

@section('content')
  <div class="panel panel-default">
    <div class="panel-heading font-bold">
      红包活动信息
    </div>
    <div class="panel-body">
      <form class="form-horizontal" url="{{ admin_action('Gift\ActivityController@showRule',[$info]) }}">
        <div class="form-group">
          <label class="col-lg-2 control-label">名称</label>
          <div class="col-lg-10">
            <p class="form-control-static">{{ $info->name }}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">状态</label>
          <div class="col-lg-10">
            <p class="form-control-static">{{ $info->status()->name }}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">活动分类</label>
          <div class="col-lg-10">
            <p class="form-control-static">{{ $info->cate()->name??'无' }}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">红包总额</label>
          <div class="col-lg-10">
            <p class="form-control-static">{{ $info->total_money }}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">已使用金额</label>
          <div class="col-lg-10">
            <p class="form-control-static">{{ $info->used_money }}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">活动类型</label>
          <div class="col-lg-10">
            <p class="form-control-static">{{ $info->type()->name }}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">活动时间</label>
          <div class="col-lg-10">
            <p class="form-control-static">{{ $info->begin_time }}&nbsp;--&nbsp;{{ $info->end_time }}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">使用规则</label>
          <div class="col-lg-5">
            <p class="form-control-static">{{ $info->used_rule?$info->used()->name:'无' }}，金额:{{ $info->used_rule_money }}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group" id="formsf">
          <label class="col-lg-2 control-label">发放规则</label>
          <div class="col-lg-5">
            <p class="form-control-static">{{ $info->grant()->name }}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">红包有效期</label>
          <div class="col-lg-10">
          @if($info->effect_time1)
            <p class="form-control-static">{{ $info->effect_time1 }}&nbsp;--&nbsp;{{ $info->effect_time2 }}</p>
          @elseif($info->effect_day)
            <p class="form-control-static">{{ $info->effect_day }}天</p>
          @endif
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-lg-4 col-lg-offset-2">
            <a href="{{ admin_action('Gift\ActivityController@index') }}" class="btn btn-default">返&nbsp;回</a>
          </div>
        </div>
      </form>
    </div>
  </div>
@endsection
@section('scripts')
<script type="text/javascript">
$(function(){
  $.get($("form").attr("url")).success(function(data){
    $("#formsf").after(data);
  });
})
</script>
@endsection